﻿using System;
using AForge.Imaging;
using AForge.Imaging.Filters;
using System.Drawing;

namespace InvariantWM
{
    class Differ
    {
        public static Bitmap getDiff(Bitmap original, Bitmap watermarked)
        {
            //Calculate difference between original and watermarked
            Difference differenceFilter = new Difference(watermarked);
            Bitmap diffImage = differenceFilter.Apply(original);

            //Adjust its contrast
            ContrastCorrection ctr = new ContrastCorrection(0.001);
            diffImage = ctr.Apply(diffImage);
            
            return diffImage;
        }
    }
}
